# /bin/sh

pack_source=blog
pack_name=blog-`date +%Y%m%d-%H%M`.tar.gz

server_user=ubuntu
server_ip=121.4.99.226
server_path=/usr/share/nginx/website


tar -czvf $pack_name $pack_source
scp $pack_name $server_user@$server_ip:$server_path

ssh $server_user@$server_ip > /dev/null 2>&1 << eeooff
cd $server_path
sudo tar -xzvf $pack_name

exit
eeooff

rm $pack_name

echo done!
